﻿using System;

class OperationsOverVariableArgs
{
    static void Main()
    {
        Minimum(1,6,8,9,4,6,45,8,9,98,65,19);
        Maximum(1,6,8,9,4,6,45,8,9,98,65,19);
        Average(1, 6, 8, 9, 4, 6, 45, 8, 9, 98, 65, 19);
        Sum(1,6,8,9,4,6,45,8,9,98,65,19);
        Product(1, 6, 8, 9, 4, 6, 45, 8, 9, 98, 65, 19);
    }

    private static void Minimum(params int[] array)
    {
        Array.Sort(array);
        Console.WriteLine("The minimum number is: {0}",array[0]);
    }

    private static void Maximum(params int[] array)
    {
        Array.Sort(array);
        Console.WriteLine("The minimum number is: {0}", array[array.Length-1]);
    }

    private static void Average(params int[] array)
    {
        int sum = 0;
        foreach (var item in array)
        {
            sum += item;
        }
        Console.WriteLine("The average is: {0}",sum/array.Length);
    }

    private static void Sum(params int[] array)
    {
        int sum = 0;
        foreach (var item in array)
        {
            sum += item;
        }
        Console.WriteLine("The average is: {0}", sum);
    }

    private static void Product(params int[] array)
    {
        long product = 1;
        foreach (var item in array)
        {
            product *= item;
        }
        Console.WriteLine("The average is: {0}", product);
    }
}
